package com.ws.client.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
import com.ws.dto.LoginFormBean;
import com.ws.entity.User;
import com.ws.service.LoginService;

@Component("cLoginAction")
@Scope(value="prototype")
public class CLoginAction extends ActionSupport {
	
	private LoginService loginService;

	@Resource(name="clientLoginServiceImpl")
	public void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}
	
	private LoginFormBean lfb;

	public LoginFormBean getLfb() {
		return lfb;
	}

	public void setLfb(LoginFormBean lfb) {
		this.lfb = lfb;
	}

	@Override
	public String execute() throws Exception {
		return loginService.doLogin(lfb.getUsername(),lfb.getPassword());
		//return loginService.doLogin("huangjian","123");
	}
	
}
